package com.quick.mybatis.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.quick.mybatis.model.PageModel;
import com.quick.mybatis.sqlprovider.CommonProvider;

//@Repository("commonMapper")
public interface CommonMapper<T> {

	@UpdateProvider(type = CommonProvider.class, method = "getUpdateSql")
	public Integer update(T t);

	@SelectProvider(type = CommonProvider.class, method = "getInsertSql")
	public Integer insert(T t);

	@SelectProvider(type = CommonProvider.class, method = "getAllInsertSql")
	public Integer insertAll(List<T> list);

	@DeleteProvider(type = CommonProvider.class, method = "getDeleteSql")
	public Integer delete(T t);

	@SelectProvider(type = CommonProvider.class, method = "getPageListSql")
	public List<Map<String,Object>> getPageList(PageModel<T> t);

	@SelectProvider(type = CommonProvider.class, method = "getListSql")
	public List<Map<String,Object>> getList(T t);

	@SelectProvider(type = CommonProvider.class, method = "getPageListCountSql")
	public Integer getPageListCount(PageModel<T> t);
	
	@SelectProvider(type = CommonProvider.class, method = "getListCountSql")
	public Integer getListCount(T t);

	@SelectProvider(type = CommonProvider.class, method = "getListAllSql")
	public List<Map<String,Object>> getListAll(T t);

	@SelectProvider(type = CommonProvider.class, method = "getByIdSql")
	public Map<String,Object> getById(String id);
	
	@SelectProvider(type = CommonProvider.class, method = "getListBySqlWhere")
	public List<Map<String,Object>> getListBySqlWhere(String sqlwhere);
	
	
	@SelectProvider(type = CommonProvider.class, method = "getSql")
	public Map<String,Object> get(T t);
	
	
	
}
